import { ArgumentMetadata, ValidationPipe } from "@nestjs/common";
import { ParseJsonPipe } from "./parse.json.pipe";

export class ValidationWsMessagePipe extends ValidationPipe {
    private parseJsonPipe = new ParseJsonPipe();

    transform(value: any, metadata: ArgumentMetadata) {
        return super.transform(this.parseJsonPipe.transform(value, metadata), metadata);
    }
}
